package com.xinghanlaser.applet.base.common.annotation;

import com.xinghanlaser.applet.base.common.utils.RegexUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @author grandpa
 * @date 2023/3/20 14:25
 * @describe 电话校验注解实现类
 */
public class PhoneValidator implements ConstraintValidator<PhoneValidated,String> {
    @Override
    public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
        return !RegexUtils.isPhoneInvalid(value);
    }
}
